import api from '../index.js'
// 获取提货申请列表
export const applyList = (params) => api.get("customer/api/user/delivery/applyList", {
	params,
	custom: {
		auth: false
	}
})

// 获取提货申请详情
export const getDeliveryDetail = id =>
	api.get(`customer/api/user/delivery/${id}`)

// 提货申请预览
export const preDelivery = (params) =>
	api.get(`customer/api/user/delivery/preDelivery`, { params })



// 提货申请
export const deliveryApply = (data) =>
	api.post("customer/api/user/delivery/deliveryApply", {
		data,
		header: {
			'Content-Type': 'application/json'
		}
	});


// 获取深文艺术账号列表
export const getSWlist = (params) => api.get(`customer/api/account/sw/list`, { params })

// 绑定深文艺术账号
export const bindSw = data =>
	api.post("customer/api/account/sw/bind", {
		data,
		header: {
			'Content-Type': 'application/json'
		}
	});

// 删除绑定深文艺术账号
export const deleteSw = id => api.delete(`customer/api/account/sw/delete/${id}`);


// 申请释放-优惠申请-日
export const applyDay = data =>
	api.post("customer/api/release/applyDay", {
		data,
		header: {
			'Content-Type': 'application/json'
		}
	});

//申请释放-优惠申请-月预览
export const applyMonthPre = params =>
	api.post("customer/api/release/applyMonth/pre", {
		params,
		header: {
			'Content-Type': 'application/json'
		}
	});

//申请释放-优惠申请-月
export const applyMonth = params =>
	api.post("customer/api/release/applyMonth", {
		params,
		header: {
			'Content-Type': 'application/json'
		}
	});

//取消申请释放-月
export const cancelApply = params =>
	api.post("customer/api/release/cancelApply", {
		params,
		header: {
			'Content-Type': 'application/json'
		}
	});


// 申请释放-优惠申请-日 记录
export const getDayLog = data =>
	api.get(`customer/api/release/applyDay/log`, { data })

// 申请释放-优惠申请-日 预览
export const getDayPre = data =>
	api.get(`customer/api/release/applyDay/pre`, { data })

// 代付-获取订单列表
export const getBehalfList = data =>
	api.get(`order/api/main/pay/behalf/list`, { data })
//代付支付
export const behalfPayment = data =>
	api.post("customer/api/order/behalfPayment", {
		data,
		header: {
			'Content-Type': 'application/json'
		}
	});
//查询活动接口
export const activityV2 = data =>
	api.post('customer/api/order/query/activityV2', {
		data,
		header: {
			'Content-Type': 'application/x-www-form-urlencoded'
		}
	})
//查询活动接口
export const behalfPaymentPre = params =>
	api.post(`customer/api/order/behalfPayment/pre`, { params })

// 获取申请释放-详情
export const applyInfo = data =>
	api.get(`customer/api/release/apply/info`, { data })

// 工分兑换-预览
export const gfPre = data =>
	api.get(`customer/api/release/apply/gf/pre`, { data })
//工分兑换
export const applyGf = data =>
	api.post("customer/api/release/apply/gf", {
		data,
		header: {
			'Content-Type': 'application/json'
		}
	});


// 兑换卡-申请兑换预览
export const exchangePre = data =>
	api.get(`customer/api/release/apply/exchange/pre`, { data })
//兑换卡-申请兑换
export const applyExchange = data =>
	api.post("customer/api/release/applyExchange", {
		data,
		header: {
			'Content-Type': 'application/json'
		}
	});


// 月结检测提示
export const checkReleaseTips = data =>
	api.get(`customer/api/checkReleaseTips`, { data })

//获取捡漏收益明细列
export const jlDetailList = data =>
	api.get(`system/api/jl/detail/rewardDetailList`, { data })

//获取直推捡漏信息
export const leaksInfo = data =>
	api.get(`customer/api/jl/info`, { data })

//获取分红明细列表
export const getDividendList = data =>
	api.get(`customer/dividend/detail/list`, { data })

//兑换分红
export const exchangeDividend = data =>
	api.get(`customer/dividend/exchange`, { data })

//获取捡漏奖励明细列表
export const rewardDetailList = data =>
	api.get(`system/api/jl/detail/rewardDetailList`, { data })

export const pickReward = data =>
	api.post("system/api/jl/detail/reward/pick", {
		data,
		header: {
			'Content-Type': 'application/json'
		}
	});


//获取申请列表 releaseType 1.日释放 2.月释放 3.兑换卡 4.工分
export const getReleaseApplyList = data =>
	api.get(`customer/api/release/apply/list`, { data })

export const dividendExchange = data =>
	api.post("customer/dividend/exchange", {
		data,
		header: {
			'Content-Type': 'application/json'
		}
	});

//获取订单-发票信息详细信息
export const getInvoiceInfo = data =>
	api.get(`order/api/invoices/getInfo`, { data })
//申请开票
export const applyInvoices = data =>
	api.post("order/api/invoices/apply", {
		data,
		header: {
			'Content-Type': 'application/json'
		}
	});

//
export const authenSms = data =>
	api.post("customer/api/sms/authenSms", {
		data,
		custom: {
			isLoading: true
		},
		header: {
			'Content-Type': 'application/json'
		}
	});
//
export const postBindingWxOpenId = (data : { code : string }) =>
	api.post("customer/api/update/openid", {
		data,
		custom: {
			isLoading: true
		}
	});

// 更换手机号-发送验证码
export const changeBindSms = data =>
	api.post("customer/api/sms/changeBind", {
		data,
		custom: {
			auth: true,
			isLoading: true
		},
		header: {
			'Content-Type': 'application/json'
		}
	});

export const updatePhoneBind = data =>
	api.post("customer/bind/updatePhoneBind", {
		data,
		custom: {
			auth: true,
			isLoading: true
		},
		header: {
			'Content-Type': 'application/json'
		}
	});
	
	//检测是否已经申请释放
	export const checkApply = data =>
		api.get(`/customer/api/release/checkApply`, { data })
		
	//获取捡漏直推用户列表
	export const swCustomerList = data =>
		api.get(`/customer/api/jl/swCustomerList`, { data })